import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询用户列表
export function listContent(query) {
  return request({
    url: '/system/ltd_content/list',
    method: 'get',
    params: query
  })
}

// 查询用户详细
export function getLtdContent(contentId) {
  return request({
    url: '/system/ltd_content/' + parseStrEmpty(contentId),
    method: 'get'
  })
}

// 新增用户
export function addContent(data) {
  return request({
    url: '/system/ltd_content',
    method: 'post',
    data: data,
    headers:{'content-type':'multipart/form-data'}
  })
}

// 修改用户
export function updateContent(data) {
  return request({
    url: '/system/ltd_content/edit',
    method: 'post',
    data: data,
    headers:{'content-type':'multipart/form-data'}
  })
}

// 删除用户
export function delContent(contentId) {
  return request({
    url: '/system/ltd_content/' + contentId,
    method: 'delete'
  })
}

// 查询菜单下拉树结构
export function menuTreeSelect() {
  return request({
    url: '/system/ltd_menu/treeselect',
    method: 'get'
  })
}

// 内容状态修改
export function changeContentStatus(contentId, contentStatus) {
  const data = {
    contentId,
    contentStatus
  }
  return request({
    url: '/system/ltd_content/changeStatus',
    method: 'put',
    data: data
  })
}
